# -*- coding:utf-8 -*-
import urllib.request
import requests
import ssl

akey = 'bN7UbbadGNuM00S5v1B0cP6H'
skey = 'aWo7ld4YaX60db7Abtqa79GSqvb5dSy1'
# 获取token
host =  'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=' + akey + '&client_secret=' + skey
headers = { 'Content-Type' :'application/json; charset=UTF-8'}
#request.add_header('Content-Type', 'application/json; charset=UTF-8')
response =  urllib.request.urlopen(host)
res = requests.get(url=host,headers=headers).json()
if (res):
    print(res['access_token'])